package com.fanxuankai.boot.monitor.confluent;

import com.fanxuankai.boot.monitor.BaseMonitorProperties;
import com.fanxuankai.boot.monitor.autoconfigure.MonitorProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author fanxuankai
 */
@ConfigurationProperties(prefix = ConfluentConnectorProperties.PREFIX)
public class ConfluentConnectorProperties extends BaseMonitorProperties<ConfluentConnectorProperties.ConnectorConfig> {
    public static final String PREFIX = MonitorProperties.PREFIX + ".confluent.connector";

    public ConfluentConnectorProperties() {
        setTitle("Confluent Connector");
        setCron("20 0/5 * * * ?");
    }

    public static class ConnectorConfig {
        private String clusters;
        private String url = "/api/connect/connect-default/connectors?expand=status&expand=info";
        private String restartUrl = "/api/connect/connect-default/connectors/{1}/restart/?includeTasks=true";
        private boolean autoRestart = true;
        private String runningState = "RUNNING";

        public String getClusters() {
            return clusters;
        }

        public void setClusters(String clusters) {
            this.clusters = clusters;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public String getRestartUrl() {
            return restartUrl;
        }

        public void setRestartUrl(String restartUrl) {
            this.restartUrl = restartUrl;
        }

        public boolean isAutoRestart() {
            return autoRestart;
        }

        public void setAutoRestart(boolean autoRestart) {
            this.autoRestart = autoRestart;
        }

        public String getRunningState() {
            return runningState;
        }

        public void setRunningState(String runningState) {
            this.runningState = runningState;
        }
    }
}
